using System.Collections;
using System.Collections.Generic;
using UnityEngine;


// 创建一个菜单项，用于在Unity编辑器中创建这个效果的实例
[CreateAssetMenu(fileName = "Buff effect", menuName = "Data/Item effect/Buff effect")]
public class Buff_Effect : ItemEffect
{
    private PlayerStats stats;
    // 序列化字段，使其在Unity编辑器中可见
    [SerializeField] private StatType buffType;
    [SerializeField] private int buffAmount;
    [SerializeField] private float buffDuration;

    // 重写基类的ExecuteEffect方法
    public override void ExecuteEffect(Transform _enemyPosition)
    {
        // 获取玩家的属性
        stats = PlayerManager.instance.player.GetComponent<PlayerStats>();
        // 增加指定属性
        stats.IncreaseStatBy(buffAmount, buffDuration, stats.GetStat(buffType));
    }
}